package com.nuanshui.heatedloan.userinfo.facade.thirdlogin;

import com.nuanshui.heatedloan.userinfo.constant.LoginAccountType;
import org.springframework.core.convert.converter.Converter;

/**
 * Created by zxh on 2017/2/10.
 */
public class ThirdUserServiceNameConverter implements Converter<Integer,String > {
    @Override
    public String convert(Integer source) {
        return getServiceName(source);
    }

    private String getServiceName(int accountType)
    {
        String serviceName=null;

        if(accountType== LoginAccountType.QQ)
        {
            serviceName= ThirdUserServiceConstant.QQUserService;
        }
        else if(accountType==LoginAccountType.WEI_XIN)
        {
            serviceName= ThirdUserServiceConstant.WeixinUserService;
        }
        else if(accountType==LoginAccountType.WEI_BO)
        {
            serviceName= ThirdUserServiceConstant.WeiboUserService;
        }

        return serviceName;
    }
}
